﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using V = Science.Mathematics.VectorCalculus;

namespace VectorCalculus5Ed.Chapter2.Section4
{
    public class Example09
    {
        public Example09()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
        public void Compute()
        {
            V.Function.ToLastType<double, double[]> map
                = new V.Function.ToLastType<double, double[]>(func);
            V.Path p = new V.Path(map);
            V.TangentLine l = new V.TangentLine(p,1.0);
            l.Parameter = 3.0;
            V.Vector v = l.GetVectorOnLine();

            result += v[0].ToString() + "\t  ";
            result += v[1].ToString() + "\t  ";
            result += v[2].ToString() + "\r\n";       
        }
        private double[] func(double t)
        {
            double[] r = new double[3];
            r[0] = Math.Exp(t);
            r[1] = Math.Exp(-t);
            r[2] = Math.Cos(t);
            return r;
        }
    }
}
// 8.15484548537777	  -0.367879441171244	  -1.14263966374803